# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=cottontail
pkgver=93.b7f5222
pkgrel=7
pkgdesc='Capture all RabbitMQ messages being sent through a broker.'
groups=('blackarch' 'blackarch-sniffer')
arch=('any')
url='https://github.com/QKaiser/cottontail'
license=('BSD')
depends=('python' 'python-coloredlogs' 'python-pika' 'python-requests'
         'python-urllib3' 'python-verboselogs')
makedepends=('git' 'python-setuptools')
source=("git+https://github.com/QKaiser/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

